package zunyi01;

/**
 * 交换字符的值
 */
public class Practice {
    static char a = 'A';
    static char b = 'B';
    static char c = 'C';
    static char d = 'D';

    public static void main(String[] args) {
        //调用我们定义的test()方法
        test();
        System.out.println("a="+a);
        System.out.println("b="+b);
        System.out.println("c="+c);
        System.out.println("d="+d);
    }
    public static void test() {
        char temp1 = 0;
        temp1=a;
        a=d;
        d=temp1;
        char temp2 = 0;
        temp2=b;
        b=c;
        c=temp2;
    }
}
